<%@page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<script>
	var form_url = $.webapp.root + "/admin/system/vote/add.do" ; 
	$(function() {
		form_url = $.webapp.root + "/admin/system/vote/update.do" ;
		$.post($.webapp.root + "/admin/system/vote/get.do", {id:$('input[name=id]').val()}, function(result) {
			if (result.id != undefined) {
				$('#form').form('load', result);
			}
		}, 'json').error(function(){$.easyui.loaded();});
	});
	
	//提交表单数据
	var submitNow = function($d, $tg, flag) {
		$.post(form_url, $("#form").form("getData"), function(result) {
			if (result.status) {
				$tg.treegrid("reload");$.easyui.loaded(); 
				alertify.success(result.msg);
				if(flag==undefined||flag==false){$d.dialog("close") ;}
			} else {
				$.easyui.loaded();$.messager.alert("错误", result.msg, "error");
			}
		}, 'json').error(function(){$.easyui.loaded();});
	};
	
	//验证表单
	var submitForm = function($d, $tg, flag) {
		if($('#form').form('validate')) {
			$.easyui.loading({ msg: "数据提交中，请稍等..." });
			submitNow($d, $tg, flag) ;
		} 
	};
</script>

<form id="form" class="easyui-form form_container">
	<input type="hidden" name="id" value="${id}" />
	<input type="hidden" name="pid" />
	<input type="hidden" name="isTitle" value="false" />
	<table class="tableform">
		<tr>
			<th style="width: 90px;">子项标题：</th>
			<td> 
				<textarea name="subject" class="easyui-validatebox" data-options="required: true" rows="5" cols="5" style="width:97%; height:80px;border:1px solid #ccc; overflow: auto;"></textarea>
			</td>
		</tr>
	</table>
</form>